package com.dingdang.controller.admin.admin;

import com.dingdang.model.AdminLeftNav;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

/**
 * 后台页面跳转控制类Gasstation
 */
@Controller
@RequestMapping("/admin/gasstation")
public class GasstationViewController {

    //  管理后台登录后首页
    @RequestMapping("gasstationIndex")
    public String index(Model model,int index,String openPage) {
        List<AdminLeftNav> allAdminLeftNav4 = new ArrayList<AdminLeftNav>(){{
                    add(new AdminLeftNav("油站管理", "gasstationIndex?index=0&openPage=gasstationCenterFirst",0));
                    add(new AdminLeftNav("发改委价格", "gasstationIndex?index=1&openPage=gasolinemodel",0));
                    add(new AdminLeftNav("洗车店管理", "gasstationIndex?index=2&openPage=shops",0));
                    add(new AdminLeftNav("洗车店提现审核", "gasstationIndex?index=3&openPage=shopSettle",0));
                }};
               allAdminLeftNav4.get(index).setIsActive(1);
                model.addAttribute("adminLeftNav",allAdminLeftNav4);
                model.addAttribute("openPage", openPage);
                model.addAttribute("isHeadActive", 4);
        return "admin/gasstationCenter";
    }
    @RequestMapping("gasstationCenterFirst")
    public String gasstationCenterFirst() {
        return "admin/gasstation";
    }

    @RequestMapping("gasolinemodel")
    public String gasolinemodel() {
        return "admin/gasolinemodel";
    }

    @RequestMapping("shops")
    public String shops() {
        return "admin/shops";
    }

    @RequestMapping("shopSettle")
    public String shopSettle() {
        return "admin/shopSettle";
    }



}
